// 此文件用于统一配置路由表
import { Navigate } from "react-router-dom";
import type { RouteObject } from "react-router-dom";
import Home from "../pages/Home";
import Login from "../pages/Login";

type myRouterObject = RouteObject & {
  key: string;
  name: string;
  icon?: React.ReactNode;
};

const router: myRouterObject[] = [
  {
    name: "主页",
    key: "home",
    path: "/home",
    element: <Home />,
  },
  {
    name: "登录",
    key: "login",
    path: "/login",
    element: <Login />,
  },
  {
    name: "重定向",
    key: "/",
    path: "/",
    element: <Navigate to="/home" />,
  },
];

export default router;
